package entity;

import java.util.HashMap;

public class Node {

    // 节点的label
    public NodeType label = NodeType.UNKNOWN;
    // 节点的name
    public String name = null;
    // 节点的id
    private Long id;

    public Node(NodeType label, String name) {
        this.label = label;
        this.name = name;
        this.id = -1L;
    }

    public Node(NodeType label, String name, Long id) {
        this.label = label;
        this.name = name;
        this.id = id;
    }

    public Node(Long id) {
        this.id = id;
    }

    public Node() {
    }

    public static HashMap<String, NodeType> nodeTypeMap = new HashMap<String, NodeType>() {{
        put("Entity", NodeType.ENTITY);
        put("Attribute", NodeType.ATTRIBUTE);
        put("Unknown", NodeType.UNKNOWN);
    }};

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public NodeType getLabel() {
        return label;
    }

    public String getName() {
        return name;
    }

    public void setLabel(NodeType label) {
        this.label = label;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Node{" +
                "label=" + label +
                ", name='" + name + '\'' +
                ", id=" + id +
                '}';
    }
}
